<h1><%= @batch.id %> - <%= @batch.description %>
  <span class='batch_name' style='background-color:<%= @batch.colour %>;'><%= @batch.name %></span>
</h1>

<table width="100%" class="batch_table">

<% for arch in @architectures do %>
  <tr>
    <th colspan="5"><%= arch.name %></th>
  </tr>
<% @batch.build_runs.each { |br|
    if br.build_type.architecture == arch then
%>
  <tr>
    <td><%= link_to 'view', :controller => 'build_runs', :action => 'show', :id => br.id %></td>
    <td class='batch_<%= br.status %>'><%= br.status %></td>
    <td><%= br.build_type.name %></td>
    <td><%= br.machine.name if br.machine %></td>
    <td><img src='/images/build.jpg'></td>
  </tr>
<%
    end
  }
%>

<% @batch.test_runs.each { |tr|
    if tr.test_type.build_type.architecture == arch then
%>
  <tr>
    <td class='batch_<%= tr.status %>'><%= tr.status %></td>
    <td><%= tr.test_type.name %></td>
    <td><%= tr.machine.name if tr.machine %></td>
  </tr>
<%
    end
  }
%>

<% end %>

</table>